# ================ 导入组件 =================
from django.urls import path
# ================= 导入drf 路由类 ================
from rest_framework.routers import DefaultRouter
# ================ 导入views =========================
from useweb import views

# === 1. 实例化 =====
router = DefaultRouter()

# === 2. 注册views ======
router.register('positions', views.PositionViews, basename="positions")
router.register('buttons', views.ButtonViews, basename="buttons")
router.register('staffs', views.StaffViews, basename="staffs")
router.register('roles', views.RolesViews, basename="roles")
router.register('permissions', views.PermissionViews, basename="permissions")
router.register('rolesperdetails', views.RolesPerDetail, basename="rolesperdetails")

urlpatterns = [
    path('login/', views.LoginView.as_view()),  # http://192.168.140.182:8000/api/v1/user/login/
    path('login/image/code/', views.ImageCodeView.as_view()), # http://192.168.140.182:8000/api/v1/user/login/image/code/
]

#===== 3. 附加到urlpatterns ========
urlpatterns += router.urls
